package com.mrlee.controller;

import com.github.pagehelper.PageInfo;
import com.mrlee.bean.Account;
import com.mrlee.service.AccountService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/21.
 */
@Controller
public class ReportController {

    @Resource
    AccountService accountService;

    @RequestMapping(value = "report")
    public String toreport(){
        return "report/report_list";
    }

    @ResponseBody
    @RequestMapping(value = "/allreport")
    public List<Account> allbill(){
        return accountService.selectallacc();
    }

    @RequestMapping(value = "/rpage")
    @ResponseBody
    public PageInfo<Account> adminByPage(@RequestParam(value = "pagenum",required = false)Integer pageNo,
                                         @RequestParam(value = "pagesize",required = false)Integer pageSize){
        return accountService.queryAccountByPageb(pageNo,3);
    }

}
